<?php
if (!defined('APP_ID')) { die('No direct script access allowed'); }

class Validation {
	private $_data = array();
	private $_rules = array();
	
	public function __construct($arr = array()) {
		if (!empty($arr)) {
			$this->value($arr);
		}
	}
	
	public function rule($field, $func, $options = null) {
		$this->_rules[] = array(
			'field' => $field,
			'func' => $func,
			'options' => $options
		);
	}
	
	public function value ($val, $key = null) {
		if (is_array($val)) {
			$this->_data = Arr::merge($this->_data, $val);
		} else if (!empty($key)) {
			$this->_data = Arr::merge($this->_data, array($key => $val));
		}
	}
	
	public function check() {
		print_r($this->_rules);
		return false;
	}

	public static function notEmpty() {
		return false;
	}
}
